package com.esun.cheetah.biz.personal.personalcommunicater;

import java.util.HashMap;

import org.json.JSONException;
import org.json.JSONObject;

import android.os.Handler;

import com.esun.cheetah.biz.personal.personalinfo.UserInfo;
import com.esun.cheetah.config.BizCode;
import com.esun.cheetah.config.Key;
import com.esun.cheetah.network.AbsInferiorityCommunicater;
import com.esun.util.log.EDebug;
/**
 * 
 * @Package com.esun.cheetah.biz.personal.personalcommunicater.BindingCardCommunicater
 * @ClassName: BindingCardCommunicater
 * @Description: TODO(Binding Card Communication)
 * @author handy <br/>
 * @date create at 2012-7-31 下午3:09:51
 *
 */
public class BindingCardCommunicater extends AbsInferiorityCommunicater {
	private String status;// 状态
	private String msg;// 返回信息
	private String bankname;
	private String bankcard;
	private String userId;
	private String truename;
	private String bankadd;
	private String bankZone;

	public BindingCardCommunicater(Handler handler, String bankname,
			String bankZone, String bankcard, String truename, String userId,
			String bankadd) {
		super(handler);
		this.bankname = bankname;
		this.bankZone = bankZone;
		this.bankcard = bankcard;
		this.truename = truename;
		this.userId = userId;
		this.bankadd = bankadd;

	}

	@Override
	public HashMap<String, String> comHashMap() {
		HashMap<String, String> hmJson = new HashMap<String, String>();
		hmJson.put(Key.KEY_ID, BizCode.BIZCODE_BINDINGCARD);

		hmJson.put("banktype", bankname);
		hmJson.put("bankzone", bankZone);
		hmJson.put("bankname", bankname);
		hmJson.put("bankcard", bankcard);
		hmJson.put("truename", truename);
		hmJson.put("identitycode", userId);
		hmJson.put("password", UserInfo.getUserInfo().getUserpwdMD5());
		hmJson.put("bankaddr", bankadd);
		// hmJson.put("isbing", "0");
		hmJson.put(Key.CK, UserInfo.getUserInfo().getCk());

		return hmJson;
	}

	@Override
	public void getJsonContent(String serverRes) throws JSONException {

		JSONObject json = new JSONObject(serverRes);
		status = json.getString(Key.STATUS);
		msg = json.getString(Key.MSG);

		EDebug.o("msg---" + msg);
		EDebug.o("status---" + status);

	}

	public String getStatus() {
		return this.status;
	}

	public String getMsg() {
		return this.msg;
	}

	// public void setStatus(String status) {
	// this.status = status;}
	//
	//
	// public void setMsg(String msg) {
	// this.msg = msg;}
}
